package ru.st.selenium;

import org.testng.annotations.Test; 

import static org.junit.Assert.*;
import ru.st.selenium.model.Film;
import ru.st.selenium.pages.TestBase;

public class AddNewFilm extends TestBase  {
 
	@Test
	public void addNewFilmOK(){
		Film film = new Film()
		   .setTitle("Gravity")
		   .setNotes("notes")
		   .setYear("2013");
		
		app.getUserHelper().loginAs(ADMIN);
		app.getFilmHelper().create(film);
		assertTrue(app.getFilmHelper().isCreate());
		app.getUserHelper().logout();
		//assertTrue(app.getFilmHelper().search(film));
		
	}
 
	@Test
	public void addNewFilmFailure(){
		Film film = new Film()
		   .setNotes("notes")
		   .setYear("2013");
		
		app.getUserHelper().loginAs(ADMIN);
		app.getFilmHelper().create(film);
		assertTrue(app.getFilmHelper().isNotCreate());
		app.getUserHelper().logout();
		//assertTrue(app.getFilmHelper().search(film));
		
	}
}
